import java.util.Scanner;
public class test43 {
    private static double calculateDistance(double x1, double y1, double x2, double y2) {
        final double EARTH_RADIUS = 6371.01;
        x1 = Math.toRadians(x1); y1 = Math.toRadians(y1);
        x2 = Math.toRadians(x2);y2 = Math.toRadians(y2);
        return EARTH_RADIUS * Math.acos(
            Math.sin(x1) * Math.sin(x2) + Math.cos(x1) * Math.cos(x2) * Math.cos(y1 - y2)
        ); }
    private static double calculateTriangleArea(double a, double b, double c) {
        double s = (a + b + c) / 2;
        return Math.sqrt(s * (s - a) * (s - b) * (s - c)); }
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.print("Enter Atlanta (lat, lon): ");
        double atlX = input.nextDouble();
        double atlY = input.nextDouble();
        System.out.print("Enter Orlando (lat, lon): ");
        double orlX = input.nextDouble();
        double orlY = input.nextDouble();
        System.out.print("Enter Savannah (lat, lon): ");
        double savX = input.nextDouble();
        double savY = input.nextDouble();
        System.out.print("Enter Charlotte (lat, lon): ");
        double chaX = input.nextDouble();
        double chaY = input.nextDouble();
        double d1 = calculateDistance(atlX, atlY, orlX, orlY);
        double d2 = calculateDistance(orlX, orlY, savX, savY);
        double d3 = calculateDistance(savX, savY, atlX, atlY);
        double d4 = calculateDistance(atlX, atlY, chaX, chaY);
        double d5 = calculateDistance(chaX, chaY, savX, savY);
        double area1 = calculateTriangleArea(d1, d2, d3);
        double area2 = calculateTriangleArea(d3, d4, d5);
        double totalArea = area1 + area2;
        System.out.println("The area of the quadrilateral is " + totalArea + " km²");
        input.close();
    }
}
